[[UIDevice currentDevice] orientation] always null

Posted by Toby Wilson on Stack Overflow See other posts from Stack Overflow or by Toby Wilson
Published on 2010-03-17T10:08:33Z Indexed on 2010/03/17 10:11 UTC
Read the original article Hit count: 527

Filed under:
|
|
|

As per the title. Calling [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] has no effect.

DidRotateToInterfaceOrientation etc events are working fine, but I need to be able to poll the device orientation arbitrarily.

How can I fix/do this?

The long story: I have a tab application with a navigation controller on each tab. The root view of tab number one is a graph that goes full screen when the orientation changes to landscape; however this needs to be checked whenever the view appears as the orientation change could have occurred elsewhere, so I was hoping to poll the orientation state whenever this view appears.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective